
jQuery.noConflict()(function($){
	

	function megaHoverOver(){
		$(this).find(".sub").stop().fadeTo('fast', 1).show();
			
		//Calculate width of all ul's
		(function($) { 
			jQuery.fn.calcSubWidth = function() {
				rowWidth = 0;
				//Calculate row
				$(this).find("ul").each(function() {					
					rowWidth += $(this).width(); 
				});	
			};
		})(jQuery); 
		
		if ( $(this).find(".row").length > 0 ) { //If row exists...
			var biggestRow = 0;	
			//Calculate each row
			$(this).find(".row").each(function() {							   
				$(this).calcSubWidth();
				//Find biggest row
				if(rowWidth > biggestRow) {
					biggestRow = rowWidth;
				}
			});
			//Set width
			$(this).find(".sub").css({'width' :biggestRow});
			$(this).find(".row:last").css({'margin':'0'});
			
		} else { //If row does not exist...
			
			$(this).calcSubWidth();
			//Set Width
			$(this).find(".sub").css({'width' : rowWidth});
			
		}
	}
	
	function megaHoverOut(){ 
	  $(this).find(".sub").stop().fadeTo('fast', 0, function() {
		  $(this).hide(); 
	  });
	}


	var config = {    
		 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 100, // number = milliseconds for onMouseOver polling interval    
		 over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
	};

	$("ul#topnav li .sub").css({'opacity':'0'});
	$("ul#topnav li").hoverIntent(config);
	$("ul#language li .sub").css({'opacity':'0'});
	$("ul#language li").hoverIntent(config);

});	

jQuery.noConflict()(function($){
$(".second a").stop().hover(function() {
                $(this).stop().animate({"right": "-=3px" }, "fast");
        },function() {
    $(this).stop().animate({"right": "+=3px" }, "fast");
        });
		        });
/*--------------------------------FONT STYLER STARTS--------------------------------*/
jQuery.noConflict()(function($){
$(document).ready(function() {
	$('#body-font').bind('change', function() {
		var font = $(this).val();
		 $('body').css('fontFamily', font);
		 
	});
	});
	});

jQuery.noConflict()(function($){
$(document).ready(function() {
	$('#header-content ').bind('change', function() {
		var font = $(this).val();
		 $('.header-content, .sidebar-title').css('fontFamily', font);
		 
	});
	});
	});

jQuery.noConflict()(function($){
$(document).ready(function() {
	$('#headings-font').bind('change', function() {
		var font = $(this).val();
		 $('h1, h2, h3, h4, h5, h6, .number, .ls-title, .page-title').css('fontFamily', font);
		 
	});
	});
	});
	

/***************************************************
			Nivo Slider
***************************************************/
jQuery.noConflict()(function($){
$(document).ready(function() {
            $('#slider').nivoSlider({
                pauseTime:5000,
                pauseOnHover:false,
				borderRadius:20
            });        
    });
});
/***************************************************
			SuperFish Menu
***************************************************/	
// initialise plugins
	jQuery.noConflict()(function(){
		jQuery('ul.sf-menu').superfish();
		jQuery('ul.l-menu').superfish();

	});
/***************************************************
			PRETTY PHOTO
***************************************************/
jQuery.noConflict()(function($){
jQuery(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({opacity:0.80,default_width:500,default_height:344,theme:'light_rounded',hideflash:false,modal:false}); 
    /*media tab*/
$(".mediatabLink").each(function(){
      $(this).click(function(){
        tabeId = $(this).attr('id');
        $(".mediatabLink").removeClass("mediaactiveLink");
        $(this).addClass("mediaactiveLink");
        $(".mediatabcontent").addClass("mediahide");
        $("#"+tabeId+"-1").removeClass("mediahide")   
        return false;	  
      });
    });
});
});
jQuery.noConflict()(function($){
jQuery(document).ready(function(){
$('.prettyGallery').prettyGallery(); 
});
 });
/***************************************************
			LIST SLIDER
**************************************************
jQuery.noConflict()(function($){
		$(document).ready(function() {

			$.featureList(
				$("#tabs li a"),
				$("#output li"), {
					start_item	:	1
				}
			);
		});
});

/***************************************************
			ACCORDION SLIDER
**************************************************
jQuery.noConflict()(function($){
				$('.kwicks').kwicks({
					max : 900,
					spacing : 0
				});
			});
			
			
/***************************************************
			MOSAIC
**************************************************
jQuery.noConflict()(function($){
				
				$('.circle').mosaic({
					opacity		:	0.8			//Opacity for overlay (0-1)
				});
				
				$('.fade').mosaic();
				
				$('.bar').mosaic({
					animation	:	'slide'		//fade or slide
				});
				
				$('.bar2').mosaic({
					animation	:	'slide'		//fade or slide
				});
				
				$('.bar3').mosaic({
					animation	:	'slide',	//fade or slide
					anchor_y	:	'top'		//Vertical anchor position
				});
				
				$('.cover').mosaic({
					animation	:	'slide',	//fade or slide
					hover_x		:	'400px'		//Horizontal position on hover
				});
				
				$('.cover2').mosaic({
					animation	:	'slide',	//fade or slide
					anchor_y	:	'top',		//Vertical anchor position
					hover_y		:	'100px'		//Vertical position on hover
				});
				
				$('.cover3').mosaic({
					animation	:	'slide',	//fade or slide
					hover_x		:	'400px',	//Horizontal position on hover
					hover_y		:	'300px'		//Vertical position on hover
				});
		    
		    });			
/***************************************************
			IMAGE HOVER
***************************************************/
jQuery.noConflict()(function($){
$(document).ready(function() {  
            $('.img-preview').each(function() {
                $(this).hover(
                    function() {
                        $(this).stop().animate({ opacity: 0.5 }, 400);
                    },
                   function() {
                       $(this).stop().animate({ opacity: 1.0 }, 400);
                   })
                });
});
});
jQuery.noConflict()(function($){
			$('#slides').slides({
				preload: true,
				generateNextPrev: false
			});
			$('#slides2').slides({
				preload: true,
				generateNextPrev: false,
				generatePagination: true
			});
		});
/***************************************************
			SlideOut
**************************************************
jQuery.noConflict()(function($){
             $('.slide-out-div').tabSlideOut({
                 tabHandle: '.handle',                              //class of the element that will be your tab
                 pathToTabImage: 'http://html.orange-idea.com/qark-/images/switch1.png',          //path to the image for the tab (optionaly can be set using css)
                 imageHeight: '100px',                               //height of tab image
                 imageWidth: '50px',                               //width of tab image    
                tabLocation: 'left',                               //side of screen where tab lives, top, right, bottom, or left
                 speed: 300,                                        //speed of animation
                 action: 'click',                                   //options: 'click' or 'hover', action to trigger animation
                 topPos: '100px',                                   //position from the top
                 fixedPosition: true                               //options: true makes it stick(fixed position) on scroll
             });
         });*/